const createDomFromString = (str) => {
    const div = document.createElement('div');
    div.innerHTML = str;
    return div.firstElementChild;
}

const mount = (component, wrapper) => {
    wrapper.appendChild(component._renderDom());
    component.onStateChange=(oldEl,newEl)=>{
        wrapper.insertBefore(newEl,oldEl);
        wrapper.removeChild(oldEl);
    }

}